package com.example.kotlinlearndemo.kotlin

/**
 * Created by zmx on 2021/10/15 15:18
 *
 */

fun main() {
    foo()
    boo()
}

fun boo() {
    var a: String? = "1"
    var b: String? = "1"

    println("boo start")

    a?.let {
        b?.apply {
            println("b")
            return@let
        }
    }

    a?.let {
        b?.apply {
            println("b")
            return@apply
        }
    }

    //此处会执行
    println("boo end")
}

fun foo() {
    var a: String? = "1"
    var b: String? = "1"

    println("foo start")

    a?.let {
        b?.apply {
            println("b")
            return@apply
        }

        return
    }

    //此处不会执行
    println("foo end")
}

